home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 January: Technology Seed / Jan. '98 ATS.toast / QuickTime™ 3.0b11 / QTPublicInterfaces / CIncludes / Devices.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-01-12  |  23.2 KB  |  724 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        Devices.h
  3.  
  4.      Contains:    Device Manager Interfaces.
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Release:    QuickTime 3.0 Beta
  8.  
  9.      Copyright:    © 1985-1997 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. */
  18. #ifndef __DEVICES__
  19. #define __DEVICES__
  20.  
  21. #ifndef __OSUTILS__
  22. #include <OSUtils.h>
  23. #endif
  24. #ifndef __FILES__
  25. #include <Files.h>
  26. #endif
  27. #ifndef __QUICKDRAW__
  28. #include <Quickdraw.h>
  29. #endif
  30. #ifndef __NAMEREGISTRY__
  31. #include <NameRegistry.h>
  32. #endif
  33. #ifndef __CODEFRAGMENTS__
  34. #include <CodeFragments.h>
  35. #endif
  36. #ifndef __DRIVERFAMILYMATCHING__
  37. #include <DriverFamilyMatching.h>
  38. #endif
  39.  
  40.  
  41.  
  42. #if PRAGMA_ONCE
  43. #pragma once
  44. #endif
  45.  
  46. #ifdef __cplusplus
  47. extern "C" {
  48. #endif
  49.  
  50. #if PRAGMA_IMPORT
  51. #pragma import on
  52. #endif
  53.  
  54. #if PRAGMA_STRUCT_ALIGN
  55.     #pragma options align=mac68k
  56. #elif PRAGMA_STRUCT_PACKPUSH
  57.     #pragma pack(push, 2)
  58. #elif PRAGMA_STRUCT_PACK
  59.     #pragma pack(2)
  60. #endif
  61.  
  62. /* Values of the 'message' parameter to a Chooser device package */
  63.  
  64. enum {
  65.     chooserInitMsg                = 11,                            /* the user selected this device package */
  66.     newSelMsg                    = 12,                            /* the user made new device selections */
  67.     fillListMsg                    = 13,                            /* fill the device list with choices */
  68.     getSelMsg                    = 14,                            /* mark one or more choices as selected */
  69.     selectMsg                    = 15,                            /* the user made a selection */
  70.     deselectMsg                    = 16,                            /* the user canceled a selection */
  71.     terminateMsg                = 17,                            /* allows device package to clean up */
  72.     buttonMsg                    = 19                            /* the user selected a button */
  73. };
  74.  
  75.  
  76. /* Values of the 'caller' parameter to a Chooser device package */
  77.  
  78. enum {
  79.     chooserID                    = 1
  80. };
  81.  
  82.  
  83. /* Values of the 'message' parameter to a Monitor 'mntr' */
  84.  
  85. enum {
  86.     initMsg                        = 1,                            /*initialization*/
  87.     okMsg                        = 2,                            /*user clicked OK button*/
  88.     cancelMsg                    = 3,                            /*user clicked Cancel button*/
  89.     hitMsg                        = 4,                            /*user clicked control in Options dialog*/
  90.     nulMsg                        = 5,                            /*periodic event*/
  91.     updateMsg                    = 6,                            /*update event*/
  92.     activateMsg                    = 7,                            /*not used*/
  93.     deactivateMsg                = 8,                            /*not used*/
  94.     keyEvtMsg                    = 9,                            /*keyboard event*/
  95.     superMsg                    = 10,                            /*show superuser controls*/
  96.     normalMsg                    = 11,                            /*show only normal controls*/
  97.     startupMsg                    = 12                            /*code has been loaded*/
  98. };
  99.  
  100.  
  101. /* control codes for DeskAccessories */
  102.  
  103. enum {
  104.     goodbye                        = -1,                            /* heap being reinitialized */
  105.     killCode                    = 1,                            /* KillIO requested */
  106.     accEvent                    = 64,                            /* handle an event */
  107.     accRun                        = 65,                            /* time for periodic action */
  108.     accCursor                    = 66,                            /* change cursor shape */
  109.     accMenu                        = 67,                            /* handle menu item */
  110.     accUndo                        = 68,                            /* handle undo command */
  111.     accCut                        = 70,                            /* handle cut command */
  112.     accCopy                        = 71,                            /* handle copy command */
  113.     accPaste                    = 72,                            /* handle paste command */
  114.     accClear                    = 73                            /* handle clear command */
  115. };
  116.  
  117. /* Control/Status Call Codes */
  118.  
  119. enum {
  120.     drvStsCode                    = 8,                            /* status call code for drive status */
  121.     ejectCode                    = 7,                            /* control call eject code */
  122.     tgBuffCode                    = 8                                /* set tag buffer code */
  123. };
  124.  
  125. /* miscellaneous Device Manager constants */
  126.  
  127. enum {
  128.     ioInProgress                = 1,                            /* predefined value of ioResult while I/O is pending */
  129.     aRdCmd                        = 2,                            /* low byte of ioTrap for Read calls */
  130.     aWrCmd                        = 3,                            /* low byte of ioTrap for Write calls */
  131.     asyncTrpBit                    = 10,                            /* trap word modifier */
  132.     noQueueBit                    = 9                                /* trap word modifier */
  133. };
  134.  
  135. /* flags used in the driver header and device control entry */
  136.  
  137. enum {
  138.     dReadEnable                    = 0,                            /* set if driver responds to read requests */
  139.     dWritEnable                    = 1,                            /* set if driver responds to write requests */
  140.     dCtlEnable                    = 2,                            /* set if driver responds to control requests */
  141.     dStatEnable                    = 3,                            /* set if driver responds to status requests */
  142.     dNeedGoodBye                = 4,                            /* set if driver needs time for performing periodic tasks */
  143.     dNeedTime                    = 5,                            /* set if driver needs time for performing periodic tasks */
  144.     dNeedLock                    = 6                                /* set if driver must be locked in memory as soon as it is opened */
  145. };
  146.  
  147.  
  148. enum {
  149.     dNeedLockMask                = 0x4000,                        /* set if driver must be locked in memory as soon as it is opened */
  150.     dNeedTimeMask                = 0x2000,                        /* set if driver needs time for performing periodic tasks */
  151.     dNeedGoodByeMask            = 0x1000,                        /* set if driver needs to be called before the application heap is initialized */
  152.     dStatEnableMask                = 0x0800,                        /* set if driver responds to status requests */
  153.     dCtlEnableMask                = 0x0400,                        /* set if driver responds to control requests */
  154.     dWritEnableMask                = 0x0200,                        /* set if driver responds to write requests */
  155.     dReadEnableMask                = 0x0100                        /* set if driver responds to read requests */
  156. };
  157.  
  158.  
  159. /* run-time flags used in the device control entry */
  160.  
  161. enum {
  162.     dOpened                        = 5,                            /* driver is open */
  163.     dRAMBased                    = 6,                            /* dCtlDriver is a handle (1) or pointer (0) */
  164.     drvrActive                    = 7                                /* driver is currently processing a request */
  165. };
  166.  
  167.  
  168. enum {
  169.     drvrActiveMask                = 0x0080,                        /* driver is currently processing a request */
  170.     dRAMBasedMask                = 0x0040,                        /* dCtlDriver is a handle (1) or pointer (0) */
  171.     dOpenedMask                    = 0x0020                        /* driver is open */
  172. };
  173.  
  174.  
  175.  
  176. struct DRVRHeader {
  177.     short                             drvrFlags;
  178.     short                             drvrDelay;
  179.     short                             drvrEMask;
  180.     short                             drvrMenu;
  181.     short                             drvrOpen;
  182.     short                             drvrPrime;
  183.     short                             drvrCtl;
  184.     short                             drvrStatus;
  185.     short                             drvrClose;
  186.     unsigned char                     drvrName[1];
  187. };
  188. typedef struct DRVRHeader                DRVRHeader;
  189. typedef DRVRHeader *                    DRVRHeaderPtr;
  190. typedef DRVRHeaderPtr *                    DRVRHeaderHandle;
  191.  
  192. struct DCtlEntry {
  193.     Ptr                             dCtlDriver;
  194.     short                             dCtlFlags;
  195.     QHdr                             dCtlQHdr;
  196.     long                             dCtlPosition;
  197.     Handle                             dCtlStorage;
  198.     short                             dCtlRefNum;
  199.     long                             dCtlCurTicks;
  200.     GrafPtr                         dCtlWindow;
  201.     short                             dCtlDelay;
  202.     short                             dCtlEMask;
  203.     short                             dCtlMenu;
  204. };
  205. typedef struct DCtlEntry                DCtlEntry;
  206.  
  207. typedef DCtlEntry *                        DCtlPtr;
  208. typedef DCtlPtr *                        DCtlHandle;
  209.  
  210. struct AuxDCE {
  211.     Ptr                             dCtlDriver;
  212.     short                             dCtlFlags;
  213.     QHdr                             dCtlQHdr;
  214.     long                             dCtlPosition;
  215.     Handle                             dCtlStorage;
  216.     short                             dCtlRefNum;
  217.     long                             dCtlCurTicks;
  218.     GrafPtr                         dCtlWindow;
  219.     short                             dCtlDelay;
  220.     short                             dCtlEMask;
  221.     short                             dCtlMenu;
  222.     SInt8                             dCtlSlot;
  223.     SInt8                             dCtlSlotId;
  224.     long                             dCtlDevBase;
  225.     Ptr                             dCtlOwner;
  226.     SInt8                             dCtlExtDev;
  227.     SInt8                             fillByte;
  228.     UInt32                             dCtlNodeID;
  229. };
  230. typedef struct AuxDCE                    AuxDCE;
  231. typedef AuxDCE *                        AuxDCEPtr;
  232. typedef AuxDCEPtr *                        AuxDCEHandle;
  233. /*    The NDRV Driver IO Entry Point and Commands */
  234.  
  235. typedef UInt16                             UnitNumber;
  236. typedef UInt32                             DriverOpenCount;
  237. typedef SInt16                             DriverRefNum;
  238. typedef SInt16                             DriverFlags;
  239. typedef UInt32                             IOCommandCode;
  240.  
  241. enum {
  242.     kOpenCommand                = 0,
  243.     kCloseCommand                = 1,
  244.     kReadCommand                = 2,
  245.     kWriteCommand                = 3,
  246.     kControlCommand                = 4,
  247.     kStatusCommand                = 5,
  248.     kKillIOCommand                = 6,
  249.     kInitializeCommand            = 7,                            /* init driver and device*/
  250.     kFinalizeCommand            = 8,                            /* shutdown driver and device*/
  251.     kReplaceCommand                = 9,                            /* replace an old driver*/
  252.     kSupersededCommand            = 10,                            /* prepare to be replaced by a new driver*/
  253.     kSuspendCommand                = 11,                            /* prepare driver to go to sleep*/
  254.     kResumeCommand                = 12                            /* wake up sleeping driver*/
  255. };
  256.  
  257. typedef struct OpaqueAddressSpaceID*     AddressSpaceID;
  258. typedef struct OpaqueIOCommandID*         IOCommandID;
  259. typedef UInt32                             IOCommandKind;
  260.  
  261. enum {
  262.     kSynchronousIOCommandKind    = 0x00000001,
  263.     kAsynchronousIOCommandKind    = 0x00000002,
  264.     kImmediateIOCommandKind        = 0x00000004
  265. };
  266.  
  267.  
  268. struct DriverInitInfo {
  269.     DriverRefNum                     refNum;
  270.     RegEntryID                         deviceEntry;
  271. };
  272. typedef struct DriverInitInfo            DriverInitInfo;
  273. typedef DriverInitInfo *                DriverInitInfoPtr;
  274.  
  275. typedef DriverInitInfo                     DriverReplaceInfo;
  276. typedef DriverInitInfo *                DriverReplaceInfoPtr;
  277.  
  278. struct DriverFinalInfo {
  279.     DriverRefNum                     refNum;
  280.     RegEntryID                         deviceEntry;
  281. };
  282. typedef struct DriverFinalInfo            DriverFinalInfo;
  283. typedef DriverFinalInfo *                DriverFinalInfoPtr;
  284.  
  285. typedef DriverFinalInfo                 DriverSupersededInfo;
  286. typedef DriverFinalInfo *                DriverSupersededInfoPtr;
  287.  
  288. /* Contents are command specific*/
  289.  
  290.  
  291. union IOCommandContents {
  292.     ParmBlkPtr                         pb;
  293.     DriverInitInfoPtr                 initialInfo;
  294.     DriverFinalInfoPtr                 finalInfo;
  295.     DriverReplaceInfoPtr             replaceInfo;
  296.     DriverSupersededInfoPtr         supersededInfo;
  297. };
  298. typedef union IOCommandContents            IOCommandContents;
  299. typedef CALLBACK_API_C( OSErr , DriverEntryPointPtr )(AddressSpaceID SpaceID, IOCommandID CommandID, IOCommandContents Contents, IOCommandCode Code, IOCommandKind Kind);
  300. /* Record to describe a file-based driver candidate */
  301.  
  302. struct FileBasedDriverRecord {
  303.     FSSpec                             theSpec;                    /* file specification*/
  304.     MacDriverType                     theType;                    /* nameInfoStr + version number*/
  305.     Boolean                         compatibleProp;                /* true if matched using a compatible name*/
  306.     UInt8                             pad[3];                        /* alignment*/
  307. };
  308. typedef struct FileBasedDriverRecord    FileBasedDriverRecord;
  309. typedef FileBasedDriverRecord *            FileBasedDriverRecordPtr;
  310. /* Driver Loader API */
  311. #define DECLARE_DRIVERDESCRIPTION(N_ADDITIONAL_SERVICES)\
  312.         struct {\
  313.             DriverDescription    fixed;\
  314.             DriverServiceInfo    additional_service[N_ADDITIONAL_SERVICES-1];\
  315.         };
  316.  
  317.  
  318. EXTERN_API_C( SInt16 )
  319. HigherDriverVersion                (NumVersion *            driverVersion1,
  320.                                  NumVersion *            driverVersion2);
  321.  
  322. EXTERN_API_C( OSErr )
  323. VerifyFragmentAsDriver            (CFragConnectionID         fragmentConnID,
  324.                                  DriverEntryPointPtr *    fragmentMain,
  325.                                  DriverDescriptionPtr *    driverDesc);
  326.  
  327. EXTERN_API_C( OSErr )
  328. GetDriverMemoryFragment            (Ptr                     memAddr,
  329.                                  long                     length,
  330.                                  ConstStr63Param         fragName,
  331.                                  CFragConnectionID *    fragmentConnID,
  332.                                  DriverEntryPointPtr *    fragmentMain,
  333.                                  DriverDescriptionPtr *    driverDesc);
  334.  
  335. EXTERN_API_C( OSErr )
  336. GetDriverDiskFragment            (FSSpecPtr                 fragmentSpec,
  337.                                  CFragConnectionID *    fragmentConnID,
  338.                                  DriverEntryPointPtr *    fragmentMain,
  339.                                  DriverDescriptionPtr *    driverDesc);
  340.  
  341. EXTERN_API_C( OSErr )
  342. InstallDriverFromFragment        (CFragConnectionID         fragmentConnID,
  343.                                  RegEntryID *            device,
  344.                                  UnitNumber             beginningUnit,
  345.                                  UnitNumber             endingUnit,
  346.                                  DriverRefNum *            refNum);
  347.  
  348. EXTERN_API_C( OSErr )
  349. InstallDriverFromFile            (FSSpecPtr                 fragmentSpec,
  350.                                  RegEntryID *            device,
  351.                                  UnitNumber             beginningUnit,
  352.                                  UnitNumber             endingUnit,
  353.                                  DriverRefNum *            refNum);
  354.  
  355. EXTERN_API_C( OSErr )
  356. InstallDriverFromMemory            (Ptr                     memory,
  357.                                  long                     length,
  358.                                  ConstStr63Param         fragName,
  359.                                  RegEntryID *            device,
  360.                                  UnitNumber             beginningUnit,
  361.                                  UnitNumber             endingUnit,
  362.                                  DriverRefNum *            refNum);
  363.  
  364. EXTERN_API_C( OSErr )
  365. InstallDriverFromDisk            (Ptr                     theDriverName,
  366.                                  RegEntryID *            theDevice,
  367.                                  UnitNumber             theBeginningUnit,
  368.                                  UnitNumber             theEndingUnit,
  369.                                  DriverRefNum *            theRefNum);
  370.  
  371. EXTERN_API_C( OSErr )
  372. FindDriversForDevice            (RegEntryID *            device,
  373.                                  FSSpec *                fragmentSpec,
  374.                                  DriverDescription *    fileDriverDesc,
  375.                                  Ptr *                    memAddr,
  376.                                  long *                    length,
  377.                                  StringPtr                 fragName,
  378.                                  DriverDescription *    memDriverDesc);
  379.  
  380. EXTERN_API_C( OSErr )
  381. FindDriverCandidates            (RegEntryID *            deviceID,
  382.                                  Ptr *                    propBasedDriver,
  383.                                  RegPropertyValueSize *    propBasedDriverSize,
  384.                                  StringPtr                 deviceName,
  385.                                  MacDriverType *        propBasedDriverType,
  386.                                  Boolean *                gotPropBasedDriver,
  387.                                  FileBasedDriverRecordPtr  fileBasedDrivers,
  388.                                  ItemCount *            nFileBasedDrivers);
  389.  
  390. EXTERN_API_C( OSErr )
  391. ScanDriverCandidates            (RegEntryID *            deviceID,
  392.                                  FileBasedDriverRecordPtr  fileBasedDrivers,
  393.                                  ItemCount                 nFileBasedDrivers,
  394.                                  FileBasedDriverRecordPtr  matchingDrivers,
  395.                                  ItemCount *            nMatchingDrivers);
  396.  
  397. EXTERN_API_C( OSErr )
  398. GetDriverForDevice                (RegEntryID *            device,
  399.                                  CFragConnectionID *    fragmentConnID,
  400.                                  DriverEntryPointPtr *    fragmentMain,
  401.                                  DriverDescriptionPtr *    driverDesc);
  402.  
  403. EXTERN_API_C( OSErr )
  404. InstallDriverForDevice            (RegEntryID *            device,
  405.                                  UnitNumber             beginningUnit,
  406.                                  UnitNumber             endingUnit,
  407.                                  DriverRefNum *            refNum);
  408.  
  409. EXTERN_API_C( OSErr )
  410. GetDriverInformation            (DriverRefNum             refNum,
  411.                                  UnitNumber *            unitNum,
  412.                                  DriverFlags *            flags,
  413.                                  DriverOpenCount *        count,
  414.                                  StringPtr                 name,
  415.                                  RegEntryID *            device,
  416.                                  CFragSystem7Locator *    driverLoadLocation,
  417.                                  CFragConnectionID *    fragmentConnID,
  418.                                  DriverEntryPointPtr *    fragmentMain,
  419.                                  DriverDescription *    driverDesc);
  420.  
  421. EXTERN_API_C( OSErr )
  422. GetDriverDescription            (LogicalAddress         fragmentPtr,
  423.                                  DriverDescriptionPtr *    theDriverDesc);
  424.  
  425. EXTERN_API_C( OSErr )
  426. SetDriverClosureMemory            (CFragConnectionID         fragmentConnID,
  427.                                  Boolean                 holdDriverMemory);
  428.  
  429. EXTERN_API_C( OSErr )
  430. ReplaceDriverWithFragment        (DriverRefNum             theRefNum,
  431.                                  CFragConnectionID         fragmentConnID);
  432.  
  433. EXTERN_API_C( OSErr )
  434. OpenInstalledDriver                (DriverRefNum             refNum,
  435.                                  SInt8                     ioPermission);
  436.  
  437. EXTERN_API_C( OSErr )
  438. RenameDriver                    (DriverRefNum             refNum,
  439.                                  StringPtr                 newDriverName);
  440.  
  441. EXTERN_API_C( OSErr )
  442. RemoveDriver                    (DriverRefNum             refNum,
  443.                                  Boolean                 immediate);
  444.  
  445. EXTERN_API_C( OSErr )
  446. LookupDrivers                    (UnitNumber             beginningUnit,
  447.                                  UnitNumber             endingUnit,
  448.                                  Boolean                 emptyUnits,
  449.                                  ItemCount *            returnedRefNums,
  450.                                  DriverRefNum *            refNums);
  451.  
  452. EXTERN_API_C( UnitNumber )
  453. HighestUnitNumber                (void);
  454.  
  455. EXTERN_API_C( OSErr )
  456. DriverGestaltOn                    (DriverRefNum             refNum);
  457.  
  458. EXTERN_API_C( OSErr )
  459. DriverGestaltOff                (DriverRefNum             refNum);
  460.  
  461. EXTERN_API_C( Boolean )
  462. DriverGestaltIsOn                (DriverFlags             flags);
  463.  
  464.  
  465. #if !OLDROUTINELOCATIONS
  466.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  467.                                                                                             #pragma parameter __D0 PBOpenSync(__A0)
  468.                                                                                             #endif
  469. EXTERN_API( OSErr )
  470. PBOpenSync                        (ParmBlkPtr             paramBlock)                            ONEWORDINLINE(0xA000);
  471.  
  472.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  473.                                                                                             #pragma parameter __D0 PBOpenAsync(__A0)
  474.                                                                                             #endif
  475. EXTERN_API( OSErr )
  476. PBOpenAsync                        (ParmBlkPtr             paramBlock)                            ONEWORDINLINE(0xA400);
  477.  
  478.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  479.                                                                                             #pragma parameter __D0 PBOpenImmed(__A0)
  480.                                                                                             #endif
  481. EXTERN_API( OSErr )
  482. PBOpenImmed                        (ParmBlkPtr             paramBlock)                            ONEWORDINLINE(0xA200);
  483.  
  484.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  485.                                                                                             #pragma parameter __D0 PBCloseSync(__A0)
  486.                                                                                             #endif
  487. EXTERN_API( OSErr )
  488. PBCloseSync                        (ParmBlkPtr             paramBlock)                            ONEWORDINLINE(0xA001);
  489.  
  490.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  491.                                                                                             #pragma parameter __D0 PBCloseAsync(__A0)
  492.                                                                                             #endif
  493. EXTERN_API( OSErr )
  494. PBCloseAsync                    (ParmBlkPtr             paramBlock)                            ONEWORDINLINE(0xA401);
  495.  
  496.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  497.                                                                                             #pragma parameter __D0 PBCloseImmed(__A0)
  498.                                                                                             #endif
  499. EXTERN_API( OSErr )
  500. PBCloseImmed                    (ParmBlkPtr             paramBlock)                            ONEWORDINLINE(0xA201);
  501.  
  502.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  503.                                                                                             #pragma parameter __D0 PBReadSync(__A0)
  504.                                                                                             #endif
  505. EXTERN_API( OSErr )
  506. PBReadSync                        (ParmBlkPtr             paramBlock)                            ONEWORDINLINE(0xA002);
  507.  
  508.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  509.                                                                                             #pragma parameter __D0 PBReadAsync(__A0)
  510.                                                                                             #endif
  511. EXTERN_API( OSErr )
  512. PBReadAsync                        (ParmBlkPtr             paramBlock)                            ONEWORDINLINE(0xA402);
  513.  
  514.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  515.                                                                                             #pragma parameter __D0 PBReadImmed(__A0)
  516.                                                                                             #endif
  517. EXTERN_API( OSErr )
  518. PBReadImmed                        (ParmBlkPtr             paramBlock)                            ONEWORDINLINE(0xA202);
  519.  
  520.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  521.                                                                                             #pragma parameter __D0 PBWriteSync(__A0)
  522.                                                                                             #endif
  523. EXTERN_API( OSErr )
  524. PBWriteSync                        (ParmBlkPtr             paramBlock)                            ONEWORDINLINE(0xA003);
  525.  
  526.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  527.                                                                                             #pragma parameter __D0 PBWriteAsync(__A0)
  528.                                                                                             #endif
  529. EXTERN_API( OSErr )
  530. PBWriteAsync                    (ParmBlkPtr             paramBlock)                            ONEWORDINLINE(0xA403);
  531.  
  532.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  533.                                                                                             #pragma parameter __D0 PBWriteImmed(__A0)
  534.                                                                                             #endif
  535. EXTERN_API( OSErr )
  536. PBWriteImmed                    (ParmBlkPtr             paramBlock)                            ONEWORDINLINE(0xA203);
  537.  
  538. EXTERN_API( void )
  539. AddDrive                        (short                     drvrRefNum,
  540.                                  short                     drvNum,
  541.                                  DrvQElPtr                 qEl);
  542.  
  543. EXTERN_API( QHdrPtr )
  544. GetDrvQHdr                        (void)                                                        THREEWORDINLINE(0x2EBC, 0x0000, 0x0308);
  545.  
  546. #endif  /*  !OLDROUTINELOCATIONS */
  547.  
  548. EXTERN_API( DCtlHandle )
  549. GetDCtlEntry                    (short                     refNum);
  550.  
  551. /*
  552.     SetChooserAlert used to simply set a bit in a low-mem global
  553.     to tell the Chooser not to display its warning message when
  554.     the printer is changed. However, under MultiFinder and System 7,
  555.     this low-mem is swapped out when a layer change occurs, and the
  556.     Chooser never sees the change. It is obsolete, and completely
  557.     unsupported on the PowerPC. 68K apps can still call it if they
  558.     wish.
  559.     
  560.     pascal Boolean SetChooserAlert(Boolean f);
  561.  
  562. */
  563.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  564.                                                                                             #pragma parameter __D0 DriverInstall(__A0, __D0)
  565.                                                                                             #endif
  566. EXTERN_API( OSErr )
  567. DriverInstall                    (DRVRHeaderPtr             drvrPtr,
  568.                                  short                     refNum)                                ONEWORDINLINE(0xA03D);
  569.  
  570.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  571.                                                                                             #pragma parameter __D0 DriverInstallReserveMem(__A0, __D0)
  572.                                                                                             #endif
  573. EXTERN_API( OSErr )
  574. DriverInstallReserveMem            (DRVRHeaderPtr             drvrPtr,
  575.                                  short                     refNum)                                ONEWORDINLINE(0xA43D);
  576.  
  577. /*
  578.   Note: DrvrInstall() is no longer supported, becuase it never really worked anyways.
  579.           There will soon be a DriverInstall() which does the right thing.
  580.  
  581.         DrvrRemove has been renamed to DriverRemove.  But, InterfaceLib for PowerPC
  582.         still exports DrvrRemove, so a macro is used to map the new name to old.
  583.  
  584. */
  585.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  586.                                                                                             #pragma parameter __D0 DrvrRemove(__D0)
  587.                                                                                             #endif
  588. EXTERN_API( OSErr )
  589. DrvrRemove                        (short                     refNum)                                ONEWORDINLINE(0xA03E);
  590.  
  591. #define DriverRemove(refNum) DrvrRemove(refNum)
  592.  
  593. EXTERN_API( OSErr )
  594. MacOpenDriver                    (ConstStr255Param         name,
  595.                                  short *                drvrRefNum);
  596.  
  597. EXTERN_API( OSErr )
  598. MacCloseDriver                    (short                     refNum);
  599.  
  600. EXTERN_API( OSErr )
  601. Control                            (short                     refNum,
  602.                                  short                     csCode,
  603.                                  const void *            csParamPtr);
  604.  
  605. EXTERN_API( OSErr )
  606. Status                            (short                     refNum,
  607.                                  short                     csCode,
  608.                                  void *                    csParamPtr);
  609.  
  610. EXTERN_API( OSErr )
  611. KillIO                            (short                     refNum);
  612.  
  613.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  614.                                                                                             #pragma parameter __D0 PBControlSync(__A0)
  615.                                                                                             #endif
  616. EXTERN_API( OSErr )
  617. PBControlSync                    (ParmBlkPtr             paramBlock)                            ONEWORDINLINE(0xA004);
  618.  
  619.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  620.                                                                                             #pragma parameter __D0 PBControlAsync(__A0)
  621.                                                                                             #endif
  622. EXTERN_API( OSErr )
  623. PBControlAsync                    (ParmBlkPtr             paramBlock)                            ONEWORDINLINE(0xA404);
  624.  
  625.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  626.                                                                                             #pragma parameter __D0 PBControlImmed(__A0)
  627.                                                                                             #endif
  628. EXTERN_API( OSErr )
  629. PBControlImmed                    (ParmBlkPtr             paramBlock)                            ONEWORDINLINE(0xA204);
  630.  
  631.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  632.                                                                                             #pragma parameter __D0 PBStatusSync(__A0)
  633.                                                                                             #endif
  634. EXTERN_API( OSErr )
  635. PBStatusSync                    (ParmBlkPtr             paramBlock)                            ONEWORDINLINE(0xA005);
  636.  
  637.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  638.                                                                                             #pragma parameter __D0 PBStatusAsync(__A0)
  639.                                                                                             #endif
  640. EXTERN_API( OSErr )
  641. PBStatusAsync                    (ParmBlkPtr             paramBlock)                            ONEWORDINLINE(0xA405);
  642.  
  643.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  644.                                                                                             #pragma parameter __D0 PBStatusImmed(__A0)
  645.                                                                                             #endif
  646. EXTERN_API( OSErr )
  647. PBStatusImmed                    (ParmBlkPtr             paramBlock)                            ONEWORDINLINE(0xA205);
  648.  
  649.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  650.                                                                                             #pragma parameter __D0 PBKillIOSync(__A0)
  651.                                                                                             #endif
  652. EXTERN_API( OSErr )
  653. PBKillIOSync                    (ParmBlkPtr             paramBlock)                            ONEWORDINLINE(0xA006);
  654.  
  655.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  656.                                                                                             #pragma parameter __D0 PBKillIOAsync(__A0)
  657.                                                                                             #endif
  658. EXTERN_API( OSErr )
  659. PBKillIOAsync                    (ParmBlkPtr             paramBlock)                            ONEWORDINLINE(0xA406);
  660.  
  661.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  662.                                                                                             #pragma parameter __D0 PBKillIOImmed(__A0)
  663.                                                                                             #endif
  664. EXTERN_API( OSErr )
  665. PBKillIOImmed                    (ParmBlkPtr             paramBlock)                            ONEWORDINLINE(0xA206);
  666.  
  667. EXTERN_API( short )
  668. OpenDeskAcc                        (ConstStr255Param         deskAccName)                        ONEWORDINLINE(0xA9B6);
  669.  
  670. EXTERN_API( void )
  671. CloseDeskAcc                    (short                     refNum)                                ONEWORDINLINE(0xA9B7);
  672.  
  673. #if CGLUESUPPORTED
  674. EXTERN_API_C( short )
  675. opendeskacc                        (const char *            deskAccName);
  676.  
  677. EXTERN_API_C( OSErr )
  678. opendriver                        (const char *            driverName,
  679.                                  short *                refNum);
  680.  
  681. #endif  /* CGLUESUPPORTED */
  682.  
  683. /*
  684.     The PBxxx() routines are obsolete.  
  685.     
  686.     Use the PBxxxSync(), PBxxxAsync(), or PBxxxImmed version instead.
  687. */
  688. #define PBControl(pb, async) ((async) ? PBControlAsync(pb) : PBControlSync(pb))
  689. #define PBStatus(pb, async) ((async) ? PBStatusAsync(pb) : PBStatusSync(pb))
  690. #define PBKillIO(pb, async) ((async) ? PBKillIOAsync(pb) : PBKillIOSync(pb))
  691.  
  692. #if !OLDROUTINELOCATIONS
  693. #define PBOpen(pb, async) ((async) ? PBOpenAsync(pb) : PBOpenSync(pb))
  694. #define PBClose(pb, async) ((async) ? PBCloseAsync(pb) : PBCloseSync(pb))
  695. #define PBRead(pb, async) ((async) ? PBReadAsync(pb) : PBReadSync(pb))
  696. #define PBWrite(pb, async) ((async) ? PBWriteAsync(pb) : PBWriteSync(pb))
  697. #endif  /*  !OLDROUTINELOCATIONS */
  698.  
  699.  
  700.  
  701.  
  702.  
  703.  
  704. #if PRAGMA_STRUCT_ALIGN
  705.     #pragma options align=reset
  706. #elif PRAGMA_STRUCT_PACKPUSH
  707.     #pragma pack(pop)
  708. #elif PRAGMA_STRUCT_PACK
  709.     #pragma pack()
  710. #endif
  711.  
  712. #ifdef PRAGMA_IMPORT_OFF
  713. #pragma import off
  714. #elif PRAGMA_IMPORT
  715. #pragma import reset
  716. #endif
  717.  
  718. #ifdef __cplusplus
  719. }
  720. #endif
  721.  
  722. #endif /* __DEVICES__ */
  723.  
  724.